extends layout
block css
  link(rel='stylesheet', href='assets/css/bootstrap.min.css')
  link(rel='stylesheet', href='assets/css/manage.css')
block main
  body(ng-app='manage')
    div#wrapper
      div#sidebar(ng-controller='manageCon')
        div#choice
          h2 选项
        div#logout-div
          button#logout.btn.btn-primary(ng-click='logout()') 登出
        div#sidebar-main
          div.part-btn(data-target='#edit-post')
            button.btn(ng-click='showEdit()') 所有文章
          div.part-btn(data-target='#write-post')
            button.btn(ng-click='showWrite()') 编写文章
          div.part-btn(data-target='#edit-comment')
            button.btn(ng-click='showComment()') 所有评论
        div#result
      div#main
        div.part#write-post(ng-controller='postWrite')
          div#edit-h2
            h2 编写博客
          div#write-main.form-horizontal
            div.form-group
              label.control-label.col-sm-1 标题
              div.col-sm-4
                input.form-control#title(ng-model='title',name='title')
            div.form-group
              label.control-label.col-sm-1 时间
              div.col-sm-4
                input.form-control#time(disabled,name='time',placeholder='时间自动获取')
            div.form-group
              label.control-label.col-sm-1 文章类型
              div.col-sm-4
                input.form-control#kind(name='kind',placeholder='选择文章类型',ng-model='kind')
            div.form-group
              label.control-label.col-sm-1 文章标识ID
              div.col-sm-4
                input.form-control#articleId(name='articleId',placeholder='确定文章标识ID',ng-model='articleId')

            div.form-group
              label.control-label.col-sm-1 作者
              div.col-sm-4
                input.form-control#author(disabled,name="author", placeholder='默认  "ZSK"')
            div.form-group
              label.control-label.col-sm-1 头像
              div.col-sm-4
                input.form-control#avatar(disabled,name='avatar',placeholder='默认设置')
            div.form-group
              label.control-label.col-sm-1 插图
              div.col-sm-4#showImg-out
                form#showImg-form()
                  button.form-control.btn.btn-primary 选择图片作文章展示图片
                  input.form-control#showImg(type='file',name='file',multiple="true")
                  //input(type="submit",style='position:absolute;left:600px;',value='提交')
            div.form-group
              label.control-label.col-sm-1 简介
              div.col-sm-8
                input.form-control#simIntro(ng-model='simIntro')
            div.form-group
              label.control-label.col-sm-1 正文
              div.col-sm-8
                textarea.form-control#content(contenteditable='true',ng-model='content') {{content}}
            div.form-group
              div.col-sm-offset-1.col-sm-8
                button.btn.btn-default.btn-lg.active(ng-click='submit(title,simIntro,content,kind,articleId)') 提交
        div.part#edit-post(ng-controller='postEdit')
          div#edit-main
            table.table.table-hover
              thead
                tr
                  th #
                  th 标题
                  th 文章类型
                  th 简介
                  th 正文
                  th 编辑
                  th 删除
              tbody
                tr(ng-repeat='post in posts')
                  th.index {{$index+1}}
                  td.title {{post.title}}
                  td.kind {{post.kind}}
                  td.intro {{post.simIntro}}
                  td.content {{post.content}}
                  td.edit
                    button.edit-btn.btn(ng-click='edit(posts[$index])') 编辑
                  td.delete
                    button.edit-btn.btn(ng-click='delete(posts[$index])') 删除
          div#editing.form-horizontal
            div.form-group
              label.control-label 标题
              div
                input.form-control#title(ng-model='editing_post.title',name='title')

            div.form-group
              label.control-label 文章类型
              div
                input.form-control#kind(name='kind',placeholder='选择文章类型',ng-model='editing_post.kind')

            div.form-group
              label.control-label 简介
              div
                input.form-control#simIntro(ng-model='editing_post.simIntro')
            div.form-group
              label.control-label 正文
              div
                textarea.form-control#content(contenteditable='true',ng-model='editing_post.content')
            div.form-group
              div
                button.btn.btn-default.btn-lg(ng-click='update()') 修改
        div.part#edit-comment(ng-controller='commentEdit')
          div#edit-main
            table.table.table-hover
              thead
                tr
                  th #
                  th 昵称
                  th 邮箱
                  th 内容
                  th 删除
              tbody
                tr(ng-repeat='comment in comments')
                  th.index {{$index+1}}
                  td.title {{comment.nickname}}
                  td.kind {{comment.mail}}
                  td.intro {{comment.commentDetail}}
                  td.delete
                    button.edit-btn.btn(ng-click='delete(comments[$index])') 删除
      div.prompt-outer
        div.prompt
block js
  script(src='assets/js/prompt.js')
  script(src='assets/js/manage.js')